package de.tu_darmstadt.gdi.battleship.tests;

import static org.junit.Assert.fail;
import junit.framework.Assert;

import org.junit.Test;

import de.tu_darmstadt.gdi.battleship.Battleground;
import de.tu_darmstadt.gdi.battleship.Map;


public class TestBattleGround {

	@Test
	public void testSetUp(){
		String path = "src/de/tu_darmstadt/gdi/battleship/tests/testlevel.lvl";
		try {
			Map map = new Map(path);
			Battleground playGround = new Battleground(map);
			String compair = "-lr-t-lr--|-lr-----t-\n"
										+"----b-----|---lhr--b-\n"
										+"----------|----------\n"
										+"--t--lhhr-|------lhr-\n"
										+"--v-------|--lhr-----\n"
										+"--v-lhhr--|t---------\n"
										+"--v------t|v-t--lhhr-\n"
										+"--b-lhr--b|v-v-------\n"
										+"----------|v-v--t-lr-\n"
										+"lhr-lhr---|b-b--b----\n";
			String toString = playGround.toString();
			Assert.assertEquals(compair, toString);
		} catch (Exception e) {
			e.printStackTrace();
			fail("unerwartete Exception wurde geworfen!");
		}
		
	}
}
